//
//  kofyClubView.m
//  KOFY
//
//  Created by Warren Holybee on 12/11/10.
//  Copyright 2010 Warren Holybee. All rights reserved.
//



#import "kofyClubView.h"
#import "defines.h"

@implementation kofyClubView
@synthesize web;
@synthesize wheel;

// The designated initializer.  Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
/*
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization.
    }
    return self;
}
*/
-(IBAction)back: (id) sender {
	
	[[self parentViewController] dismissModalViewControllerAnimated:NO];
}


// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
	NSLog(@"kofyClubView viewDidLoad");
	
	NSHTTPCookie *cookie;
	for (cookie in [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies]) {
		NSLog(@"%@", cookie);
	}
	
	[[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways];
	
	
	[super viewDidLoad];
    NSURL *url = [NSURL URLWithString:KOFYCLUBURL];
	NSURLRequest *request =[NSURLRequest requestWithURL:url];
	self.web.scalesPageToFit=YES;
	[self.web loadRequest:request];
	
	
}


/*
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations.
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
*/

- (void)didReceiveMemoryWarning {
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc. that aren't in use.
}

- (void)viewDidUnload {
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}


- (void)dealloc {
    [super dealloc];
}

-(void)webViewDidStartLoad:(UIWebView *)webView {
	[self.wheel startAnimating];
}

-(void)webViewDidFinishLoad:(UIWebView *)webView {
	[self.wheel stopAnimating];
}

@end
